#!/bin/sh
#
# Control the iRODS servers.
#
# Usage is:
#	irodsctl [options]
#
# Type 'irodsctl --help' for a list of options.
#
# This shell script runs the 'irodsctl' Perl script.
#
IRODS_HOME="/home/jerome/src/irodspython/PyRods"

if [ ! -s $IRODS_HOME ]; then
	# If configured but not correct now, try logic below
	IRODS_HOME=""
fi

if [ "$IRODS_HOME" = "" ]; then
	# Try using the current directory
	IRODS_HOME=`pwd`
	if [ ! -d $IRODS_HOME/scripts ]; then
		echo "Please run 'irodssetup' first to configure and build iRODS."
		exit 1
	fi
fi
$IRODS_HOME/scripts/runperl --dir $IRODS_HOME --script $IRODS_HOME/scripts/perl/irodsctl.pl $*
ExitCode="$?"
exit $ExitCode

